<template>
  <div>
    {{total}}
  </div>
</template>

<script>
export default {
props:['goodList'],
computed:{
  total(){
    return this.goodList.reduce((sum,item)=>{
      return sum+item.num*item.price
    },0)
  }
}
}
</script>

<style scoped>
div {
  text-align: center;
}
</style>